Repository navigation
fix(pr-review): verify the approval closeout comparison - #9171
Conversation
Signed-off-by: LoopX Agent <[email protected]>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI (runtime_reported, xhigh)
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
运行 GitHub 审批收尾的维护者需要用一致的 PR 比较范围核对已有评审。基线在 head 不变且比较范围中途变化时仍可能返回 clear。候选在首读缺少 base 时拒绝,在两次读取的 base 或文件数不一致时要求重试。验证范围包括模拟 GitHub 两次读取的真实 CLI、稳定 PR 的只读 GitHub 调用和本地预合并检查。本次未在真实 PR 上制造并发改基线,也未查询托管检查。 现有收尾合同
改动思路 / Approach
在现有 GitHub 适配器的两次 PR 读取中核对 base OID 和文件数。现有 TypeScript planner 继续核对当前 head、完整评审历史和已有批准,收尾仍为只读。
现有两次 GitHub 读取已覆盖评审历史的前后,在适配器核对比较字段即可复用现有收尾判定。变更集中在现有只读 GitHub 适配器,TypeScript 收尾规则和授权边界沿用原有实现。
具体改动 / Changes
候选 0035129ae05f4fc38733eb066c2d338efd2a0dec 对目标 d083494ee265f012b10a7c837cc756b17486abeb 变更 3 文件,新增 50 行、移除 2 行。
- comparison-read 首读要求可用的 base OID;同一 head 的后读核对 base 与文件数。 GitHub 适配器
- unchanged-closeout head 移动和生命周期变化仍由既有路径处理。稳定输入继续允许原来的收尾结论,并保留已有批准和阻塞评审规则。
- read-authority CLI 沿用只读读取,回传继续标明撤销评审和合并权限均未授权。
语义与 CI 对齐
沿用现有 GitHub 比较字段、错误通道和收尾状态。PR 文档说明比较变动后应重试;没有新增共享词表。
对主干的风险 / Risks
将三条新负例移到原生产代码重放,均返回错误的 clear,测试按预期失败。候选的三套相关测试共 160 项通过。四个独立对照分别验证稳定比较、head 移动、首读缺失 base 和生命周期变化。真实 GitHub 稳定 PR 保留 exact_head_approval_missing。本地 quick premerge、Ruff、diff 检查通过。两次观测可检测返回的版本差异,无法证明 GitHub 在间隔内从未发生随后撤销的变化。
我的整体评价 / Verdict
APPROVE。 现有适配器在覆盖的比较变化中停止输出旧快照的收尾结论。稳定、head 变化和生命周期变化路径继续得到各自的只读结果。
English verdict: APPROVE at 0035129. Approval closeout fails closed on detectable base or changed-file-count drift at an unchanged head while preserving stable and existing head/lifecycle outcomes.
Problem
The approval closeout command uses the changed-file inventory to decide which review evidence applies. A GitHub comparison can change while the command reads review history, even when the source commit is unchanged. Closeout could report a result using the earlier inventory.
Change
Check the comparison base and changed-file count in the existing GitHub readback. If the comparison changes or its base becomes unavailable, stop and tell the caller to retry closeout. Keep source-head and lifecycle checks on the existing paths.
Validation
clearon the original code and rejected the inconsistent readback after the fix.git diff --checkpassed.